function change(obj){
    obj.src="/verification";
}
let yzm = null;
let vue = new Vue({
    el: "#app",
    methods: {
        yzm: function () {
            yzm = this.$refs.yzm.value;
        }
    }
});
$(function () {
    $(".login_btn").on("click",function () {
        let username = $("input[name='username']").val();
        let password = $("input[name='password']").val();
        let code = $("input[name='code']").val();
        if(username == ""){
            layer.msg("请输入用户名");
            return false;
        }else if(password == ""){
            layer.msg("请输入密码");
            return false;
        }else{
            $.ajax({
                url: "/manage/login",
                type: "post",
                data: {"adminName":username,"adminPassword":password,"code":code},
                dataType: "json",
                success: function (result) {
                    if(result["msg"] == 1){
                        window.location = "../../index.html";
                    }else if(result["msg"] ==2){
                        layer.msg("用户名密码输入有误");
                        return false;
                    }else{
                        layer.msg("验证码输入有误");
                        return false;
                    }
                }
            })
        }

    })
});